<template>
  <!-- 拖动临时存放处 viewStyleObject 控制显示位置，跟随鼠标显示 -->
  <div id="tmp_wk" class="tmp-wk" v-bind:style="dragViewStyleObject">
    <div :is="item.component" class="active" v-if="item" :obj="item" v-for="(item, i) in tmp_items" :key="i"></div>
  </div>
</template>

<script>
import address from './libs/address'
import checkbox from './libs/checkbox'
import date from './libs/date'
import email from './libs/email'
import hr from './libs/hr'
import input from './libs/input'
import inputCurrency from './libs/input-currency'
import inputNumber from './libs/input-number'
import page from './libs/page'
import radio from './libs/radio'
import select from './libs/select'
import selectMulti from './libs/select-multi'
import tableDefault from './libs/table-default'
import tableLeft from './libs/table-left'
import tableTop from './libs/table-top'
import tel from './libs/tel'
import textarea from './libs/textarea'
import upatta from './libs/upatta'
import upimg from './libs/upimg'
import word from './libs/word'
import elipse from './libs/elipse'

export default {
  name: 'dragView',
  components: {
    'v-address': address,
    'v-checkbox': checkbox,
    'v-date': date,
    'v-email': email,
    'v-hr': hr,
    'v-input': input,
    'v-input-currency': inputCurrency,
    'v-input-number': inputNumber,
    'v-page': page,
    'v-radio': radio,
    'v-select': select,
    'v-select-multi': selectMulti,
    'v-table-default': tableDefault,
    'v-table-left': tableLeft,
    'v-table-top': tableTop,
    'v-tel': tel,
    'v-textarea': textarea,
    'v-upatta': upatta,
    'v-upimg': upimg,
    'v-word': word,
    'v-elipse': elipse
  },
  data: function () {
    return {
      tmp_items: this.$dragView.items,
      dragViewStyleObject: this.$dragView.styleObject
    }
  }
}
</script>
